Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank / Experiments |
(map (lambda (n . x) '1) '(2 3 4 5))
"hello"
'hello
%%python
def myfunc(a, b):
return a ** b
retval = myfunc
(define myfunc _)
(myfunc 2 4)
Calysto Scheme can use Python data and modules.
%matplotlib notebook
(import "matplotlib")
(import-as "matplotlib.pyplot" 'plt)
(plt.plot (vector 1 2 3))
(plt.savefig "myfig")
;;(display (plt.show))
(display (plt.bar (range 3) '(1 2 3)))
(plt.show)
Conx is a Python library that uses a GPU for computation for running neural networks (built on Theano).
(import "conx")
(define network (conx.Network 2 2 1))
;; should be able to use lists; limitation with numpy?
;; in any event, we avoid the issue and use Python's list (eg, vector)
(define inputs (vector (vector (vector 0 0) (vector 0))
(vector (vector 0 1) (vector 1))
(vector (vector 1 0) (vector 1))
(vector (vector 1 1) (vector 1))))
(network.set_inputs inputs)
(network.train)